package day20170506.ch02;

import java.io.OutputStream;
import java.net.Socket;

public class ScoketTest {
	
	public static void main(String[] args) throws Exception  {
		
		//获取到服务器的ip和端口
		Socket socket = new Socket("192.168.3.96", 8888);
		OutputStream inputStream = socket.getOutputStream();
		String str = "luozhihao";
		
		byte[] bytes = str.getBytes();
		inputStream.write(bytes);
		
		
		inputStream.close();
		socket.close();
		System.out.println("发送成功");
	}
}
